package org.thread.test05.demo06.demo04;

/**
 * sleep 方法与 wait方法的使用
 *
 * @author ZJL
 * @date 2025-03-13
 */
public class MainTest extends Object {
    public static void main(String[] args) throws InterruptedException {
        MyThread t1 = new MyThread();
        MyThread t2 = new MyThread();
        MyThread t3 = new MyThread();
        t1.start();
        t2.start();
        t3.start();
        // 主线程睡眠5秒后唤醒子线程
        Thread.sleep(5000);
        synchronized (MyThread.LOCK){
            MyThread.LOCK.notify();
        }
    }
}
